package Test_0731;

public class Test {
    public static void Eat(Animal animal){
        animal.eat();
    }
    public static void main(String[] args) {
       /* Dog dog1 = new Dog();
        Animal animal=dog1;
        Dog dog2 = new Dog();
        Eat(dog2);
        Eat(dog2);
        //匿名对象
        Eat(new Dog());
        Eat(new Dog());*/
    }
}
